<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>服务器管理</title>
	<meta name="decorator" content="default"/>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/projectdemo/server/">服务器列表</a></li>
		<shiro:hasPermission name="projectdemo:server:edit"><li><a href="${ctx}/projectdemo/server/form">服务器添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="server" action="${ctx}/projectdemo/server/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>服务器名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="32" class="input-medium"/>
			</li>
			<li><label>服务器类型：</label>
				<select name="servertype" style="width:150px;">
					<option value=""></option>
					<c:forEach items="${alltype}" var="type">
						<option value="${type.type}">${type.type}</option>
					</c:forEach>
				</select>			
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>服务器名称</th>
				<th>用户名</th>
				<th>密码</th>
				<th>内网IP</th>
				<th>外网IP</th>
				<th>域名</th>
				<th>备注</th>
				<th>添加时间</th>
				<th>服务器类型</th>
				<shiro:hasPermission name="projectdemo:server:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="server">
			<tr>
				<td><a href="${ctx}/projectdemo/server/form?id=${server.id}">
					${server.name}
				</a></td>
				<td>
					${server.user}
				</td>
				<td>
					${server.password}
				</td>
				<td>
					${server.intranetip}
				</td>
				<td>
					${server.extraneip}
				</td>
				<td>
					${server.domain}
				</td>
				<td>
					${server.remark}
				</td>
				<td>
					<fmt:formatDate value="${server.creattime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					${server.servertype}
				</td>
				<shiro:hasPermission name="projectdemo:server:edit"><td>
    				<a href="${ctx}/projectdemo/server/form?id=${server.id}">修改</a>
					<a href="${ctx}/projectdemo/server/delete?id=${server.id}" onclick="return confirmx('确认要删除该服务器吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>